package com.pinghua.mocha.basics.enumerate;

import com.coffee.core.CoffeeEnum;

/**
 * @author songkui
 * @since 2024/5/8 18:08
 */
public enum DriverLicenseEnum implements CoffeeEnum<String> {
    A("A", "A类照"),
    B("B", "B类照"),
    C("C", "C类照");

    private final String code;
    private final String label;

    DriverLicenseEnum(String code, String label){
        this.code = code;
        this.label = label;
    }


    @Override
    public String code() {
        return this.code;
    }

    @Override
    public String label() {
        return this.label;
    }

    public static DriverLicenseEnum ofCode(String code) {
        for (DriverLicenseEnum genderEnum : values()) {
            if (genderEnum.code.equals(code)) {
                return genderEnum;
            }
        }
        return null;
    }


}
